//
//  CommitDataLaterAddCell.m
//  ShangHaiTuJI
//
//  Created by xiaoxiangtuji on 2017/11/2.
//  Copyright © 2017年 xiaoxiangtuji. All rights reserved.
//

#import "CommitDataLaterAddCell.h"

@implementation CommitDataLaterAddCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self setupUI];
    }
    return self;
}
-(void)setupUI{
    //图片的上部分
    UILabel *titleLabel = [[UILabel alloc] init];
    titleLabel.adjustsFontSizeToFitWidth = YES;
    titleLabel.text = @"上传比赛作品";
    titleLabel.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.contentView.mas_centerX);
        make.left.equalTo(self.contentView.mas_left).offset(scaleLeftAndRight(140));
        make.height.mas_equalTo(scaleTopAndBottom(30));
        make.top.equalTo(self.contentView.mas_top).offset(scaleTopAndBottom(15));
    }];
    UIImageView *leftView = [[UIImageView alloc] init];
    [self.contentView addSubview:leftView];
    [leftView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(scaleLeftAndRight(125));
        make.top.equalTo(self.contentView.mas_top).offset(scaleTopAndBottom(25));
        make.size.mas_equalTo(CGSizeMake(10, 10));
    }];
    UIImageView *rightView = [[UIImageView alloc] init];
    [self.contentView addSubview:rightView];
    [rightView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView.mas_right).offset(scaleLeftAndRight(-125));
        make.top.equalTo(self.contentView.mas_top).offset(scaleTopAndBottom(25));
        make.size.mas_equalTo(CGSizeMake(10, 10));
    }];
    _centerImageview = [[UIImageView alloc] init];
    _centerImageview.image = [UIImage imageNamed:@"大"];
    [self.contentView addSubview:_centerImageview];
    [_centerImageview mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(scaleLeftAndRight(10));
        make.right.equalTo(self.contentView.mas_right).offset(scaleLeftAndRight(-10));
        make.top.equalTo(titleLabel.mas_bottom).offset(scaleLeftAndRight(10));
        make.height.mas_equalTo(scaleTopAndBottom(175));
    }];
    _centerImageview.userInteractionEnabled = YES;
    self.descriptextVeiw = [[UITextView alloc] init];
    self.descriptextVeiw.font = [UIFont systemFontOfSize:14];
    [self.contentView addSubview:self.descriptextVeiw];
    [self.descriptextVeiw mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(scaleLeftAndRight(20));
        make.top.equalTo(_centerImageview.mas_bottom).offset(scaleTopAndBottom(10));
        make.right.equalTo(self.contentView.mas_right).offset(scaleLeftAndRight(-20));
        make.height.mas_equalTo(scaleTopAndBottom(100));
    }];
    self.placeHolder = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, scaleLeftAndRight(150), 15)];
    self.placeHolder.font = [UIFont systemFontOfSize:14];
    self.placeHolder.text = @"简单介绍作品";
    self.placeHolder.textColor = COLOR_HEX(0xC0C0C0);
    [self.descriptextVeiw addSubview:self.placeHolder];
    self.stirngLenghLabel = [[UILabel alloc] initWithFrame:CGRectZero];
    self.stirngLenghLabel.textColor = COLOR_HEX(0xADADAD);
    self.stirngLenghLabel.textAlignment = NSTextAlignmentRight;
    self.stirngLenghLabel.text = @"0/500";
    self.stirngLenghLabel.font = [UIFont systemFontOfSize:10];
    [self.contentView addSubview:self.stirngLenghLabel];
    [self.stirngLenghLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.descriptextVeiw.mas_right);
        make.bottom.equalTo(self.descriptextVeiw.mas_bottom);
        make.width.mas_equalTo(scaleLeftAndRight(100));
        make.height.mas_equalTo(scaleTopAndBottom(15));
    }];
    //图片的下部分
    UILabel *titleLabel1 = [[UILabel alloc] init];
    titleLabel1.text = @"填写报名信息";
    titleLabel1.adjustsFontSizeToFitWidth = YES;
    titleLabel1.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:titleLabel1];
    [titleLabel1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.contentView.mas_centerX);
        make.left.equalTo(self.contentView.mas_left).offset(scaleLeftAndRight(140));
        make.height.mas_equalTo(scaleTopAndBottom(30));
        make.top.equalTo(_descriptextVeiw.mas_bottom).offset(scaleTopAndBottom(10));
    }];
    UIImageView *leftView1 = [[UIImageView alloc] init];
    [self.contentView addSubview:leftView1];
    [leftView1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(scaleLeftAndRight(125));
        make.top.equalTo(_descriptextVeiw.mas_bottom).offset(scaleTopAndBottom(20));
        make.size.mas_equalTo(CGSizeMake(10, 10));
    }];
    UIImageView *rightView1 = [[UIImageView alloc] init];
    [self.contentView addSubview:rightView1];
    [rightView1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView.mas_right).offset(scaleLeftAndRight(-125));
        make.top.equalTo(_descriptextVeiw.mas_bottom).offset(scaleTopAndBottom(20));
        make.size.mas_equalTo(CGSizeMake(10, 10));
    }];
    leftView.image = [UIImage imageNamed:@"图层-14"];
    leftView1.image = [UIImage imageNamed:@"图层-14"];
    rightView.image = [UIImage imageNamed:@"图层-14"];
    rightView1.image = [UIImage imageNamed:@"图层-14"];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
